package com.yonyou.cyxdms.basedata.service.entity.brand;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;
import com.yonyou.cyxdms.framework.bean.dto.base.DMSBaseDTO;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.time.LocalDateTime;

/**
 * 品牌
 *
 * @author renwd
 * @since 2018/12/7
 */
@TableName("tm_brand")
public class BrandPO extends DMSBasePO<BrandPO> {

    /**
     * id
     */
    @TableId(value = "BRAND_ID", type = IdType.AUTO)
    private Long brandId;

    /**
     * APP_ID
     */
    @TableField("APP_ID")
    private String appId;


    /**
     * 公司代码
     */
    @TableField("COMPANY_CODE")
    private String companyCode;

    /**
     * 所有者代码
     */
    @TableField("OWNER_CODE")
    private String ownerCode;

    /**
     * 所有者的父组织代码（用于二网使用）
     */
    @TableField("OWNER_PAR_CODE")
    private String ownerParCode;

    /**
     * 品牌代码
     */
    @TableField("BRAND_CODE")
    private String brandCode;
    /**
     * 品牌名称
     */
    @TableField("BRAND_NAME")
    private String brandName;
    /**
     * 资料来源
     */
    @TableField("DATA_SOURCES")
    private Integer dataSources;
    /**
     * 是否有效
     */
    @TableField("IS_VALID")
    private Integer isValid;

    /**
     * 供应商代码-SAP接口使用
     */
    @TableField("PRODUCT_CODE")
    private String productCode;
    /**
     * 供应商名称-SAP接口使用
     */
    @TableField("PRODUCT_NAME")
    private String productName;

    /**
     * 上游数据来源ID
     */
    @TableField("SOURCE_ID")
    private String sourceId;

    @TableField("SOURCE_CHANGED_AT")
    private LocalDateTime sourceChangedAt;

    /**
     * 是否整车销售品牌 是为销售品牌 否为售后品牌
     */
    @TableField("IS_VEHICLE_SALES_BRAND")
    private Integer isVehicleSalesBrand;

    @TableField("START_TYPE")
    private Integer startType;

    @TableField("START_DATE")
    private LocalDateTime startDate;
    
    @TableField("UPDATED_AT")
    private LocalDateTime updatedAt;

    @TableField("IS_ISSUE")
    private Integer isIssue;

    @TableField("SEND_DATE")
    private LocalDateTime sendDate;
    
    @TableField("SEND_BY")
    private String sendBy;
    
    public Long getBrandId() {
        return brandId;
    }

    public void setBrandId(Long brandId) {
        this.brandId = brandId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getCompanyCode() {
        return companyCode;
    }

    public void setCompanyCode(String companyCode) {
        this.companyCode = companyCode;
    }

    public String getOwnerCode() {
        return ownerCode;
    }

    public void setOwnerCode(String ownerCode) {
        this.ownerCode = ownerCode;
    }

    public String getOwnerParCode() {
        return ownerParCode;
    }

    public void setOwnerParCode(String ownerParCode) {
        this.ownerParCode = ownerParCode;
    }

    public String getBrandCode() {
        return brandCode;
    }

    public void setBrandCode(String brandCode) {
        this.brandCode = brandCode;
    }

    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    public Integer getDataSources() {
        return dataSources;
    }

    public void setDataSources(Integer dataSources) {
        this.dataSources = dataSources;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getSourceId() {
        return sourceId;
    }

    public void setSourceId(String sourceId) {
        this.sourceId = sourceId;
    }

    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }

    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }

    public Integer getIsVehicleSalesBrand() {
        return isVehicleSalesBrand;
    }

    public void setIsVehicleSalesBrand(Integer isVehicleSalesBrand) {
        this.isVehicleSalesBrand = isVehicleSalesBrand;
    }

    public Integer getStartType() {
        return startType;
    }

    public void setStartType(Integer startType) {
        this.startType = startType;
    }

    public LocalDateTime getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDateTime startDate) {
        this.startDate = startDate;
    }
    

    @Override
    public LocalDateTime getUpdatedAt() {
		return updatedAt;
	}

	@Override
    public void setUpdatedAt(LocalDateTime updatedAt) {
		this.updatedAt = updatedAt;
	}

	
	public Integer getIsIssue() {
		return isIssue;
	}

	public void setIsIssue(Integer isIssue) {
		this.isIssue = isIssue;
	}

	public LocalDateTime getSendDate() {
		return sendDate;
	}

	public void setSendDate(LocalDateTime sendDate) {
		this.sendDate = sendDate;
	}

	public String getSendBy() {
		return sendBy;
	}

	public void setSendBy(String sendBy) {
		this.sendBy = sendBy;
	}

	@Override
    public String toString() {
        return "BrandPO{" +
                "brandId=" + brandId +
                ", appId='" + appId + '\'' +
                ", companyCode='" + companyCode + '\'' +
                ", ownerCode='" + ownerCode + '\'' +
                ", ownerParCode='" + ownerParCode + '\'' +
                ", brandCode='" + brandCode + '\'' +
                ", brandName='" + brandName + '\'' +
                ", dataSources=" + dataSources +
                ", isValid=" + isValid +
                ", productCode='" + productCode + '\'' +
                ", productName='" + productName + '\'' +
                ", sourceId=" + sourceId +
                ", sourceChangedAt=" + sourceChangedAt +
                ", isVehicleSalesBrand=" + isVehicleSalesBrand +
                ", startType=" + startType +
                ", startDate=" + startDate +
                ", updatedAt=" + updatedAt +
                '}';
    }

    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author renwd
     * @since 2018/7/22 0022
     */
    protected <T extends DMSBaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "brandId");
    }


}
